﻿//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1998-2024 Glodon Company Limited.
//
// Licensed under the MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the “Software”),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include <set>

namespace gcmp
{
    enum class EnOrthogonalGridGroupAnchorPositionType
    {
        BottomLeft = 0,
        TopLeft,
        TopRight,
        BottomRight,
        Center
    };

    enum class EnRadialGridGroupAnchorPositionType
    {
        Left = 0,
        Right,
        Center
    };

    enum class EnGridGroupType
    {
        Orthogonal,
        Radial
    };

    //用于创建批量正交轴网Action的参数
    struct OrthogonalGridGroupParam
    {
        typedef std::vector<std::pair<std::wstring, double>> AxisPositionSet;

        //横向轴间距
        AxisPositionSet HorizAxis;
        //纵向轴间距
        AxisPositionSet VertiAxis;
        //锚点位置类型
        EnOrthogonalGridGroupAnchorPositionType AnchorType;
        //是否放置旋转
        bool Rotate;
    };

    //用于创建批量辐射轴网Action的参数
    struct RadialGridGroupParam
    {
        typedef std::vector<std::pair<std::wstring, double>> AxisPositionSet;

        //径向轴线轴间角
        AxisPositionSet RadiusAxis;
        //环向轴线轴间距
        AxisPositionSet CircularAxis;
        //锚点位置类型
        EnRadialGridGroupAnchorPositionType AnchorType;
        //内弧半径
        double InnerRadius;
        //是否放置旋转
        bool Rotate;
    };

    //用于恢复批量轴网参数面板的参数
    struct GridGroupDlgConfigParam
    {
        struct GridGroupDlgConfigCommonParam
        {
            //添加值
            std::wstring AddInputValue;
            //轴号类型
            int SerialNumTypeIndex;
            //起始轴号
            int SerialNumStartIndex;
            //辅助符号：前缀、后缀
            int SerialNumAuxTypeIndex;
            //辅助符号str
            std::wstring SerialNumAuxStr;
            //轴间距及数量(恢复界面使用)
            std::vector<std::pair<std::wstring, std::wstring>> TableWidgetValue;
        };

        struct OrthogonalGridGroupDlgConfigParam
        {
            GridGroupDlgConfigCommonParam LeftParam;
            GridGroupDlgConfigCommonParam RightParam;
            //锚点位置类型
            EnOrthogonalGridGroupAnchorPositionType AnchorType;
            //是否放置旋转
            bool Rotate;
        };

        struct RadialGridGroupDlgConfigParam
        {
            GridGroupDlgConfigCommonParam LeftParam;
            GridGroupDlgConfigCommonParam RightParam;
            //内弧半径
            double InnerRadius;
            //锚点位置类型
            EnRadialGridGroupAnchorPositionType AnchorType;
            //是否放置旋转
            bool Rotate;
        };

        //批量轴网类型
        EnGridGroupType CurrentGridGroupType;
        //正交轴网参数
        OrthogonalGridGroupDlgConfigParam orthogDlgConfigParam;
        //辐射轴网参数
        RadialGridGroupDlgConfigParam RadDlgConfigParam;
    };

}











